import java.awt.Graphics;

/**
 * project5
 *
 * brief description of the program
 *
 * This program is released to public domain according to
 * author's wish, you can view full license at
 * http://tomatoeskit.org/upload/PublicDomainLicense.txt
 *
 * @author Fangning CHENG (Alpha.L Cheng) <chengf@purdue.edu>
 *
 * @lab section number 
 *
 * @date Oct 21, 2013
 *
 */

public class Square implements Shape {
    private int centerX;
    private int centerY;
    private int radius;
    private int halfA;
    Square(int cX, int cY, int r)
    {
        centerX = cX;
        centerY = cY;
        radius  = r;
        halfA   = (int) (radius / Math.sqrt(2));
    }
    
    public void draw(Graphics g)
    {
        g.drawRect(centerX - halfA, centerY - halfA, 2 * halfA, 2 * halfA);
    }
}
